<?php

namespace Modules\Admin\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class AuthLoginRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'username' => 'required|regex:/^[a-zA-Z0-9]{4,14}$/',
            'password'  => 'required|regex:/^[a-zA-Z0-9]{4,14}$/',
        ];
    }

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }


    public function messages()
    {
        return [
            'username.required' => '请输入账号！',
            'username.regex' => '账号格式不正确！',
            'password.required' => '请输入密码！',
            'password.regex' => '密码格式不正确！',

        ];
    }



}
